package metier.entities;



import java.util.ArrayList;
import java.util.List;

import javax.persistence.DiscriminatorColumn;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="Utilisateur")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@DiscriminatorColumn(name="Type_Usr")
public class Utilisateur {
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer IdUtilisateur;
	private String username;
	private String password;
	private String Email;
	private boolean Statut;
	
	
	//liste des messages emis
	@OneToMany(mappedBy="Emeteur")
	private List<Message> listeMessagesEmis=new ArrayList<Message>();
	
	//liste des messages recus
	@OneToMany(mappedBy="Recepteur")
	private List<Message> listeMessagesRecu=new ArrayList<Message>();
	
	
	
	
	
	public List<Message> getListeMessagesEmis() {
		return listeMessagesEmis;
	}
	public void setListeMessagesEmis(List<Message> listeMessagesEmis) {
		this.listeMessagesEmis = listeMessagesEmis;
	}
	public List<Message> getListeMessagesRecu() {
		return listeMessagesRecu;
	}
	public void setListeMessagesRecu(List<Message> listeMessagesRecu) {
		this.listeMessagesRecu = listeMessagesRecu;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	
	
	public Integer getIdUtilisateur() {
		return IdUtilisateur;
	}
	public void setIdUtilisateur(Integer idUtilisateur) {
		IdUtilisateur = idUtilisateur;
	}
	
	
	public String getEmail() {
		return Email;
	}
	public void setEmail(String email) {
		Email = email;
	}
	public boolean getStatut() {
		return Statut;
	}
	public void setStatut(boolean statut) {
		Statut = statut;
	}
	
	
	
	
	public Utilisateur(String username, String password, String email,
			boolean statut) {
		super();
		this.username = username;
		this.password = password;
		Email = email;
		Statut = statut;
	}
	public Utilisateur() {
		super();
	}
	
	
	
	

}
